﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage/List2.Master"  AutoEventWireup="true" CodeBehind="Bu_AuditBatch_List.aspx.cs" Inherits="Honestysoft.Financing.WebUI.Module.Audit.Bu_AuditBatch_List"  %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">		
    <div class="query_area">
		批次：<asp:TextBox ID="numBatchNo" runat="server"  cssClass="input2" onbeforepaste="numboxPaste();" onkeypress="isInt();"></asp:TextBox>&nbsp;&nbsp;
		状态：<asp:DropDownList ID="ddlBatchStatus" runat="server" cssClass="input2" ></asp:DropDownList>&nbsp;&nbsp;
        <asp:Button runat="server" ID="btnQuery" Text="查 找" CssClass="btn_normal" 
			onMouseOver="this.className='btn_active'" 
            onMouseOut="this.className='btn_normal'" OnClick="btnQuery_Click" />
    </div>            
    

    <div class="button_area">
                <asp:Button runat="server" ID="btnAdd" CssClass="btn_normal" 
			        onMouseOver="this.className='btn_active'" 
                    onMouseOut="this.className='btn_normal'" Text="新 增"/>
                <asp:Button runat="server" ID="btnDelete" CssClass="btn_normal" 
			        onMouseOver="this.className='btn_active'" 
                    onMouseOut="this.className='btn_normal'" Text="删 除" 
                    OnClientClick="javascript:var ret=getNoSelectionAlert('chkID','请选择要删除的记录后再执行此操作！');if(ret){return confirm('删除批次将同时删除该批次的审核作业表！你确定要删除所选的记录吗?')}else{return false;}"             
                    onclick="btnDelete_Click" />
            </div>

            <table cellpadding="0" width="100%" cellspacing="0" border="1" class="t1" id="tGrid">
		<thead>  
            <th align="center" width="30px">
                <input type="checkbox" name="chkAll" value="checkbox" onclick='javascript:checkAll(this,"chkID")' />
            </th>
            <th align="center" >批次</th>
            <th align="center" width="120px">实际开始日期</th>
            <th align="center" width="120px">实际结束日期</th>
            <th align="center" width="100px">状态</th>
            <th align="center" width="100px">创建人</th>
            <th align="center" width="120px">创建时间</th>
            <th width="80px">操作</th>
      	</thead>           
		<asp:Repeater runat="server" ID="rptList">
			<ItemTemplate>
				<tr>
					<td align="center" >
                        <%# GetCheckbox(DataBinder.Eval(Container.DataItem,"ID")+"", DataBinder.Eval(Container.DataItem, "BatchStatus") + "") %>
					</td>
					<td><%#  DataBinder.Eval(Container.DataItem,"BatchNo") %></td>
					<td><%# string.Format("{0:yyyy-MM-dd}", DataBinder.Eval(Container.DataItem,"StartDate")) %></td>
					<td><%# string.Format("{0:yyyy-MM-dd}",  DataBinder.Eval(Container.DataItem,"EndDate")) %></td>
                    <td><%# Honestysoft.EnumHelper.EnumInstance.GetEnumDataText(typeof(Honestysoft.Financing.Model.EnumItem.BatchStatus), DataBinder.Eval(Container.DataItem,"BatchStatus")+"") %></td>
                    <td><%#  DataBinder.Eval(Container.DataItem, "CreatorName")%></td>
					<td><%#  string.Format("{0:yyyy-MM-dd HH:mm:ss}",DataBinder.Eval(Container.DataItem, "CreateTime"))%></td>
                    
					<td>
						<%# GetButtonScript(DataBinder.Eval(Container.DataItem, "ID") + "", DataBinder.Eval(Container.DataItem, "BatchStatus") + "")%>
					</td>
				</tr>  
			</ItemTemplate>
		</asp:Repeater>
        <tr>
            <td colspan="8" style="line-height: 28px;text-align:left;">
                <frameworkwebcontrols:aspnetpager id="AspNetPager1" runat="server"
                    alwaysshow="true" firstpagetext="首页" lastpagetext="尾页" nextpagetext="下一页" pageindexboxtype="DropDownList"
                    prevpagetext="上一页" showpageindex="true" showcustominfosection="Right" submitbuttontext="Go"
                    textafterpageindexbox="页" textbeforepageindexbox="转到" currentpagebuttonposition="End"
                    layouttype="Div" custominfotextalign="Right" custominfohtml="共%RecordCount%条记录。第%CurrentPageIndex%页，共%PageCount%页，每页%PageSize%条"
                    direction="LeftToRight" onpagechanged="AspNetPager1_PageChanged">
                </frameworkwebcontrols:aspnetpager>            
            </td>
        </tr>
    </table>

    
    <asp:HiddenField runat="server" ID="hidIsActive" />
    <script language="javascript" type="text/javascript">
        function checkHasActive() {
            if (document.getElementById("<%=hidIsActive.ClientID %>").value == "1") {
                return true;
            }
            return false;
        }
    </script>
    <script language="javascript" type="text/javascript">
        function openDialog2() {
            var obj = new Object();
            obj.name = "新增资金申请批次";
            var ret = checkHasActive();
            if (ret) {
                alert('当前存在未结束的批次，不能再新增批次！');
            }
            else {
                var url = '<%=Honestysoft.Baseframework.WebUI.Globals.Home %>Module/Audit/BatchEdit.aspx?FunctionID=<%=Request["FunctionID"]+"" %>';
                var UrlTmp = escape(url);
                var retValue = window.showModalDialog('<%=Honestysoft.Baseframework.WebUI.Globals.Home %>Scripts/ShowDlg.aspx?url=' + UrlTmp, obj, 'scroll:0;status:0;help:1;resizable:0;dialogWidth:500px;dialogHeight:400px');
                if (typeof (retValue) != "undefined" && retValue != null && retValue) {
                    var id = retValue.split('|')[0];
                    var text = retValue.split('|')[1];
                    //window.parent.addNode(id, text);
                    window.parent.refreshTree(id);
                }
            }
        }
        function openEditDialog(id) {
            var obj = new Object();
            obj.name = "修改资金申请批次";
            var url = '<%=Honestysoft.Baseframework.WebUI.Globals.Home %>Module/Audit/BatchEdit.aspx?FunctionID=<%=Request["FunctionID"]+"" %>';
            var UrlTmp = escape(url);
            var retValue = window.showModalDialog('<%=Honestysoft.Baseframework.WebUI.Globals.Home %>Scripts/ShowDlg.aspx?url=' + UrlTmp, obj, 'scroll:0;status:0;help:1;resizable:0;dialogWidth:500px;dialogHeight:400px');
            if (typeof (retValue) != "undefined" && retValue != null && retValue) {
                window.location.href = window.location.href;
                window.parent.editChildNode(retValue.split('|')[0], retValue.split('|')[1]);
            }
        }
</script>
</asp:Content>